SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Author:		<Author,,Name>
-- Create date: <Create Date,,>
-- Description:	<Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[UpdateMember]
	-- Add the parameters for the stored procedure here
	@fullname nvarchar(max), @Mobile nvarchar(11), @HomePhone nvarchar(10),
	@Email nvarchar, @committeName nvarchar, @CollegeName nvarchar, @UniversityName nvarchar,
	@PositionName nvarchar, @state bit, @address nvarchar, @hiredate date, @BirthDate date, 
	@ProfilePicture nvarchar, @Comments nvarchar
	
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	Update Member
	Set 	FullName = @fullname,
	Mobile = @Mobile,
	HomePhone = @HomePhone,
	Email = @Email, 
	CommitteeID = dbo.GetCommitteId(@committeName),
	CollegeID = dbo.GetCollegeId( @CollegeName ),
	UniversityID = dbo.GetUniversityId( @UniversityName ),
	PositionID = dbo.GetPosId(	@PositionName ),
	Member.state = @state , 
	Member.Address = @address , 
	HireYear = @hiredate ,
	Birthdate = @BirthDate, 
	ProfilePicture = @ProfilePicture , 
	Comments = @Comments 
	where Mobile= @Mobile;
END
GO
